import Mock from "mockjs";

// 定义数据类型

let data = Mock.mock({
    // 20条数据
    "data|200": [
       { "id|+1":10000001,
        "name|1": ["小学英语","小学语文","小学数学"],
        vxname:'@ctitle(2,4)',
        // course:'vue-project/src/assets/images/1.jpg',
        "discount|1":["100元优惠券","未领"],
        "money|1":['¥1000','¥1500','¥2000'],
        "state|1":['已支付','待支付','已关闭'],
        date: '@datetime("2021-MM-dd ")',
        dingdan:'订单详情',
      },  
    ],
    meta: {
        status: 200,
        message: "success",
    },
});

class StudentsService {
    getDate() {
        return Promise.resolve({
            data,
        });
    }
    getset(id){
        let datas={}
      data.data=data.data.filter((itme)=>{

        if(itme.id==id){
            datas=itme
        } 
        return data
      })
       return Promise.resolve({
        datas,
    });
    }
    
}

const service = new StudentsService();
export default service;